﻿using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AngleExpress.web
{
    class QihuWebOpener : WebOpener
    {
        public QihuWebOpener() : base("360driver")
        {

        }
        protected override IWebDriver initDriver()
        {
            string driverPath = System.AppDomain.CurrentDomain.BaseDirectory;
            ChromeDriverService driverService = ChromeDriverService.CreateDefaultService(driverPath, "360driver.exe");
            driverService.HideCommandPromptWindow = true;

            ChromeOptions options = new ChromeOptions();
            var ss = Environment.UserName;
            options.BinaryLocation = @"C:\Users\"+ Environment.UserName + @"\AppData\Local\360Chrome\Chrome\Application\360chrome.exe";
            options.AddArgument("disable-infobars");
            return new OpenQA.Selenium.Chrome.ChromeDriver(driverService, options);
        }
    }
}
